<%= form_for(@user) do |f| %>
  <% if @user.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>

      <ul>
      <% @user.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :userid %><br />
    <%= f.text_field :userid %>
  </div>
  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  <div class="field">
    <%= f.label :email %><br />
    <%= f.text_field :email %>
  </div>
  <div class="field">
    <%= f.label :date_of_birth %><br />
    <%= f.date_select :date_of_birth, {:start_year => Time.now.year, :end_year => Time.now.year - 100} %>
  </div>
  <div class="field">
    <%= f.label :user_type %><br />
    <%= f.select :user_type, User::USER_TYPES %>
  </div>
  <div>
    <%= f.label :password, 'Password' %>:<br />
    <%= f.password_field :password, :size => 40 %>
  </div>

  <div>
    <%= f.label :password_confirmation, 'Confirm' %>:<br />
    <%= f.password_field :password_confirmation, :size => 40 %>
  </div>
  <br />
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
